Skip to content

fix(deps): remove unused playwright dependency, clean up install docs#101

Merged
billy-enrizky merged 13 commits intomainfrom
fix/remove-playwright-dep
Mar 15, 2026
Merged

fix(deps): remove unused playwright dependency, clean up install docs#101
billy-enrizky merged 13 commits intomainfrom
fix/remove-playwright-dep

Conversation

@billy-enrizky
Copy link
Copy Markdown
Owner

@billy-enrizky billy-enrizky commented Mar 15, 2026

Summary

  • Remove playwright from base dependencies -- saves ~46MB per install. Playwright was never imported at runtime (verified via AST parsing of every .py file). All browser install paths use uvx playwright install which downloads playwright independently.
  • Remove broken Textual TUI -- the Textual-based interactive UI was non-functional (stuck on launch). Removed entirely (~1,200 lines). Bare openbrowser-ai command now shows help with usage examples. Removed [cli] extra (textual dependency) from pyproject.toml.
  • Move Quick Install before Homebrew in README.md and docs/quickstart.mdx -- one-liner scripts are the fastest onboarding path.
  • Remove mandatory "Install Browser" section -- OpenBrowser auto-detects system browsers (Chrome, Edge, Brave, Chromium) via LocalBrowserWatchdog._find_installed_browser_path() and auto-installs Chromium on first run if none found.
  • Fix flaky CLI test -- openbrowser-ai -c (no argument) now handles daemon auto-start timeout gracefully instead of propagating TimeoutError as exit code 1.
  • Graceful error when agent deps missing -- bare command and -p mode now show a clear install hint instead of crashing with ImportError.
  • Simplify install script fallbacks -- replace python -m playwright install (requires pip dep) with uvx playwright install (independent).

Commits

Commit Description
ff4fc85 Move Quick Install first, remove Install Browser section
46b4c96 Remove playwright from base dependencies
abb1b03 Replace playwright CLI fallback with uvx playwright
1c130b4 Handle daemon auto-start timeout in -c help path
218e8fd Graceful error when agent deps missing for prompt mode
823c753 Remove broken TUI, bare command now shows help

Test plan

  • AST-parsed every .py in src/openbrowser/ -- zero playwright imports
  • uv sync removes playwright from venv -- confirmed find_spec('playwright') is None
  • All 8 CLI tests pass (test_cli_c_help)
  • Bare openbrowser-ai shows help text (no crash, no TUI hang)
  • openbrowser-ai --version works
  • -p mode with missing agent deps shows clear error message
  • Previously flaky test_c_no_arg_verbose_when_daemon_not_running now passes reliably

Summary by CodeRabbit

  • Documentation

    • Reorganized installation/quickstart flow and Homebrew placement; clarified macOS/Linux/Windows install tabs and browser setup messaging.
    • Clarified that no separate browser install is required; OpenBrowser auto-detects browsers and may install Chromium on first run.
  • Improvements

    • Reduced CLI startup work in select modes and improved user-facing messaging when optional components are absent.
  • Bug Fixes

    • Prevented unnecessary browser recovery attempts that could hang initial startup.
  • Chores

    • Removed an unused dependency and simplified install scripts.

…ection

Quick Install (curl/PowerShell one-liner) is now the first installation
method in both README.md and docs/quickstart.mdx. The standalone
"Install Browser" section is removed because OpenBrowser auto-detects
system browsers (Chrome, Edge, Brave, Chromium) via
LocalBrowserWatchdog._find_installed_browser_path() and auto-installs
Chromium on first run if none found. Added Windows PowerShell install
to quickstart.mdx Quick Install tab.
Playwright is never imported at runtime -- verified via AST parsing of
every .py file in src/openbrowser/. It was only used as a CLI tool for
browser installation, but all install paths already use
`uvx playwright install` which downloads playwright independently.
Saves ~46MB of Node.js driver binaries from pip install.
The install scripts previously fell back to `playwright install chromium`
and `python -m playwright install chromium` which required the playwright
pip package. Now falls back to `uvx playwright install chromium` which
works independently. Simplifies install.ps1 from 3 nested try/catch to 2.
When `openbrowser-ai -c` (no argument) prints the function reference,
it also tries to pre-start the daemon. If the daemon start times out,
the TimeoutError propagated up and caused exit code 1 even though the
help text was already printed. Wrap the best-effort daemon start in
try/except so help output always exits 0.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly streamlines the installation process and reduces the core dependency footprint of the OpenBrowser project. By removing an unused playwright dependency and clarifying browser installation steps, it aims to improve user onboarding and reduce installation size. Additionally, it enhances the robustness of the command-line interface by making daemon startup more resilient.

Highlights

  • Dependency Removal: Removed 'playwright' from base dependencies, resulting in a ~46MB reduction per install, as it was not imported at runtime.
  • Documentation Reordering: Moved 'Quick Install' instructions before 'Homebrew' in README.md and docs/quickstart.mdx to prioritize the fastest onboarding path.
  • Simplified Browser Installation: Removed the mandatory 'Install Browser' section from documentation, clarifying that OpenBrowser auto-detects system browsers or installs Chromium on first run.
  • CLI Stability Improvement: Fixed a flaky CLI test by gracefully handling daemon auto-start timeouts in the openbrowser-ai -c command.
  • Install Script Refinement: Simplified install script fallbacks by replacing python -m playwright install with uvx playwright install for independent browser installation.
Changelog
  • README.md
    • Reordered installation sections to prioritize 'Quick install' over 'Homebrew'.
    • Removed explicit 'Install Browser' section, replacing it with an informative note about automatic browser detection.
  • docs/quickstart.mdx
    • Adjusted the order of installation tabs, placing 'Quick install' first.
    • Replaced the 'Install Browser' section with an informational block explaining browser auto-detection.
  • install.ps1
    • Updated browser installation fallback logic to use 'uvx playwright install' instead of direct 'playwright install' or 'python -m playwright install' commands.
    • Simplified warning messages related to Chromium installation failures.
  • install.sh
    • Modified browser installation fallback logic to prefer 'uvx playwright install' over previous 'playwright install' or 'python -m playwright install' methods.
    • Streamlined warning messages for Chromium installation issues.
  • pyproject.toml
    • Removed 'playwright' from the main project dependencies.
  • src/openbrowser/cli.py
    • Implemented error handling for 'TimeoutError' and 'OSError' during the daemon auto-start process when running the CLI help command.
  • uv.lock
    • Removed entries for 'greenlet', 'playwright', and 'pyee' packages.
    • Updated the 'openbrowser-ai' package definition to remove 'playwright' from its dependencies and required distributions.
Activity
  • AST-parsed every '.py' file in 'src/openbrowser/' to confirm zero playwright imports.
  • Verified that 'uv sync' successfully removes playwright from the virtual environment, confirming 'find_spec('playwright') is None'.
  • Confirmed that all 8 core module imports pass without playwright (openbrowser, MCP server, daemon, executor, watchdog, CLI, logging_config).
  • Ensured 18/18 tests pass, including 'test_executor', 'test_daemon', and 'test_cli_c_help'.
  • Confirmed that the previously flaky 'test_c_no_arg_verbose_when_daemon_not_running' now passes reliably.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

Warning

Rate limit exceeded

@billy-enrizky has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a851fb89-b339-4cc8-9e56-27cc0468bda5

📥 Commits

Reviewing files that changed from the base of the PR and between a27451b and feae2be.

📒 Files selected for processing (7)
  • README.md
  • docs/quickstart.mdx
  • src/openbrowser/cli.py
  • src/openbrowser/daemon/server.py
  • tests/test_advanced_features.py
  • tests/test_cli_c_help.py
  • tests/test_daemon_integration.py
📝 Walkthrough

Walkthrough

Reorders installation docs and Homebrew placement, consolidates browser-install messaging (OpenBrowser auto-detects and may install Chromium on first run), prefers uvx playwright install chromium in installers with simplified fallbacks, removes playwright dependency, and adds guarded/lazy imports plus resilient error handling in the CLI and MCP server.

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/quickstart.mdx
Reordered install instructions: Homebrew moved to its own subsection/tab; unified messaging that OpenBrowser auto-detects Chromium and can install Chromium on first run; removed separate "Install Browser" step; updated Windows PowerShell wording.
Installers
install.ps1, install.sh
Switched Chromium install path to prefer uvx playwright install chromium; simplified fallback messaging and removed nested Python/playwright fallback, advising openbrowser-ai install or manual install if skipped.
Dependencies
pyproject.toml
Removed playwright from project dependencies; removed standalone cli extras and dropped cli from the composite [project.optional-dependencies].all.
CLI / Runtime Guards
src/openbrowser/cli.py
Made Agent/Controller/AgentSettings imports optional (guarded on ImportError); reduced heavy startup for --mcp and default paths; wrapped daemon/status/start calls with try/except for best-effort behavior; enforce error+exit when prompt mode requires agent extras.
MCP Server
src/openbrowser/mcp/server.py
Changed CDP recovery to run only when an existing browser session (self.browser_session) is present, avoiding recovery attempts when no session exists.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as CLI
  participant Agent as Agent (optional)
  participant Daemon as Daemon
  participant User as User

  CLI->>CLI: parse args (--mcp / prompt / default)
  alt --mcp requested
    CLI->>CLI: avoid heavy imports, best-effort telemetry
    CLI-->>User: start MCP mode (minimal deps)
  else prompt requested
    CLI->>Agent: attempt guarded import
    alt Agent present
      CLI->>Daemon: check/start daemon (try/except)
      Daemon-->>CLI: running
      CLI->>Agent: start agent flow
      Agent-->>User: interactive prompt flow
    else Agent missing
      CLI-->>User: print install-agent-extras guidance and exit
    end
  else default
    CLI-->>User: show simplified help/output (no heavy TUI init)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇
I nudged the docs and moved Homebrew to bed,
Let Chromium slumber till the first run's fed,
CLI learned to tiptoe without heavy weights,
Installers now whisper simpler fates,
A little hop, a tidy trail — onward I sped.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: removing the unused playwright dependency from base dependencies and reorganizing installation documentation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-playwright-dep
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully removes the unused playwright dependency, which significantly reduces the installation size. The documentation and installation scripts have been updated accordingly to reflect this change, improving the user onboarding experience. I've found a couple of minor areas for improvement in the installation scripts' warning messages to avoid potential user confusion. The fix for the flaky CLI test is also a welcome addition for stability. Overall, this is a solid set of changes.

Comment thread install.ps1 Outdated
catch {
Write-Warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
}
Write-Warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The warning message "run 'openbrowser-ai install' after installing uv" might be confusing for users who don't have uv installed, as the script can also use pipx or pip. A more generic message would be clearer.

            Write-Warn "Chromium install skipped. Please run 'openbrowser-ai install' manually after installation completes."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Updated to: "Chromium install skipped. Please run 'openbrowser-ai install' manually after installation completes."

Comment thread install.sh Outdated
uvx playwright install chromium 2>/dev/null || warn "Chromium install failed (run 'openbrowser-ai install' manually)"
else
"$PYTHON" -m playwright install chromium 2>/dev/null || warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The warning message "run 'openbrowser-ai install' after installing uv" could be confusing if the user doesn't have uv installed, since pipx or pip might be used for installation instead. A more general instruction would be more helpful.

Suggested change
warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
warn "Chromium install skipped. Please run 'openbrowser-ai install' manually after installation completes."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Same generic message applied.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/openbrowser/cli.py (1)

67-70: Silently ignoring daemon start failures may leave orphaned processes.

When _start_daemon() times out, the subprocess has already been spawned (via subprocess.Popen with start_new_session=True in client.py:54-60) but the socket isn't ready yet. Silently ignoring this means:

  1. A daemon process continues running in the background
  2. Subsequent -c calls may spawn additional daemons or encounter conflicts

Consider logging a debug message on failure so users can diagnose issues, or checking if a daemon is already starting before spawning another:

Suggested improvement
 			try:
 				asyncio.run(client._start_daemon())
 			except (TimeoutError, OSError):
-				pass  # Best-effort daemon pre-start; failure is not fatal for help output
+				pass  # Best-effort; daemon may still be starting in background

At minimum, the comment could note that the daemon may continue starting in the background.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openbrowser/cli.py` around lines 67 - 70, The current CLI silently
swallows exceptions from client._start_daemon(), which can leave a spawned
subprocess (created via subprocess.Popen with start_new_session=True in the
daemon startup flow) running; update the except block in the CLI where
client._start_daemon() is called to at minimum log a debug/warn message that the
daemon may still be starting and include the caught exception, and preferably
add a guard (e.g., call into a client.is_starting_or_running() helper or check
for an existing socket) before attempting to spawn a new daemon to avoid
duplicates; reference client._start_daemon and the subprocess.Popen
start_new_session behavior when adding the log and/or the pre-spawn check.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/openbrowser/cli.py`:
- Around line 67-70: The current CLI silently swallows exceptions from
client._start_daemon(), which can leave a spawned subprocess (created via
subprocess.Popen with start_new_session=True in the daemon startup flow)
running; update the except block in the CLI where client._start_daemon() is
called to at minimum log a debug/warn message that the daemon may still be
starting and include the caught exception, and preferably add a guard (e.g.,
call into a client.is_starting_or_running() helper or check for an existing
socket) before attempting to spawn a new daemon to avoid duplicates; reference
client._start_daemon and the subprocess.Popen start_new_session behavior when
adding the log and/or the pre-spawn check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7420891d-82ff-4003-aa3f-102be05182d4

📥 Commits

Reviewing files that changed from the base of the PR and between 1db91fd and 1c130b4.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • README.md
  • docs/quickstart.mdx
  • install.ps1
  • install.sh
  • pyproject.toml
  • src/openbrowser/cli.py
💤 Files with no reviewable changes (1)
  • pyproject.toml

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes Playwright as a direct runtime dependency and updates installation/docs to reflect a “no separate browser install” experience, while making the CLI’s daemon pre-start best-effort in the -c (no code) path.

Changes:

  • Drop playwright (and its transitive deps) from pyproject.toml / uv.lock.
  • Update install scripts + docs to prefer openbrowser-ai install / uvx playwright install chromium and message “no separate browser install needed”.
  • Make daemon pre-start in the -c no-argument path non-fatal on failures.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
uv.lock Removes Playwright-related packages from the lockfile.
pyproject.toml Drops playwright from core dependencies.
src/openbrowser/cli.py Wraps daemon pre-start with try/except for best-effort output.
install.sh Adjusts Chromium install behavior to use openbrowser-ai install or uvx playwright ....
install.ps1 Same as install.sh for Windows PowerShell.
README.md Updates install/browser-install guidance and reorganizes install sections.
docs/quickstart.mdx Mirrors README guidance in docs quickstart flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/openbrowser/cli.py Outdated
Comment on lines +67 to +70
try:
asyncio.run(client._start_daemon())
except (TimeoutError, OSError):
pass # Best-effort daemon pre-start; failure is not fatal for help output
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Wrapped both status() and _start_daemon() calls in try/except that catches TimeoutError, OSError, and asyncio.CancelledError. The status() call now returns None on failure, and the logic falls through to the verbose description path.

Comment thread README.md Outdated
# or
playwright install chromium
```
> **No separate browser install needed.** OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found, Chromium is installed automatically on first run. To pre-install manually: `openbrowser-ai install`
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Updated both README.md and docs/quickstart.mdx to clarify: "If none is found and uvx is available, Chromium is installed automatically on first run."

Comment thread docs/quickstart.mdx Outdated
playwright install chromium
```
<Info>
**No separate browser install needed.** OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found, Chromium is installed automatically on first run. To pre-install manually: `openbrowser-ai install`
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Same clarification applied to quickstart docs.

Comment thread install.sh Outdated
Comment on lines +157 to +163
info "Installing Chromium browser..."
if command -v openbrowser-ai >/dev/null 2>&1; then
openbrowser-ai install 2>/dev/null || warn "Chromium install failed (run 'openbrowser-ai install' manually)"
elif command -v playwright >/dev/null 2>&1; then
playwright install chromium 2>/dev/null || warn "Chromium install failed (run 'playwright install chromium' manually)"
elif command -v uvx >/dev/null 2>&1; then
uvx playwright install chromium 2>/dev/null || warn "Chromium install failed (run 'openbrowser-ai install' manually)"
else
"$PYTHON" -m playwright install chromium 2>/dev/null || warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the warning message in fda5e2d. Now says "Please run 'openbrowser-ai install' manually after installation completes" without mentioning uv specifically. Note that openbrowser-ai install itself shells out to uvx -- this is by design since uv is the recommended installer and most users will have it.

Comment thread install.ps1
Comment on lines +164 to 172
$null = Get-Command 'uvx' -ErrorAction Stop
& uvx playwright install chromium 2>$null
if ($LASTEXITCODE -ne 0) {
Write-Warn "Chromium install failed (run 'playwright install chromium' manually)"
Write-Warn "Chromium install failed (run 'openbrowser-ai install' manually)"
}
}
catch {
try {
Invoke-Python -Arguments @('-m', 'playwright', 'install', 'chromium') 2>$null
if ($LASTEXITCODE -ne 0) {
Write-Warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
}
}
catch {
Write-Warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
}
Write-Warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fda5e2d. Same generic warning message applied to install.ps1.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="install.sh">

<violation number="1" location="install.sh:163">
P2: This new fallback skips Chromium installation for successful pip/pipx installs whenever the freshly installed CLI is not yet on PATH. Use a post-install path that doesn't depend on `openbrowser-ai` or `uvx` being immediately available.</violation>

<violation number="2" location="install.sh:163">
P3: Warning message incorrectly tells the user to install `uv` even though the script supports `pipx` and `pip` as install methods. If the user installed via `pip`/`pipx` and just needs a shell restart for PATH to update, this message is misleading. Use a more generic message.</violation>
</file>

<file name="install.ps1">

<violation number="1" location="install.ps1:171">
P3: Warning message incorrectly tells the user to install `uv` even though the script supports `pipx` and `pip` as install methods. If the user installed via `pip`/`pipx` and just needs a shell restart for PATH to update, this message is misleading. Use a more generic message.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread install.sh Outdated
uvx playwright install chromium 2>/dev/null || warn "Chromium install failed (run 'openbrowser-ai install' manually)"
else
"$PYTHON" -m playwright install chromium 2>/dev/null || warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This new fallback skips Chromium installation for successful pip/pipx installs whenever the freshly installed CLI is not yet on PATH. Use a post-install path that doesn't depend on openbrowser-ai or uvx being immediately available.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At install.sh, line 163:

<comment>This new fallback skips Chromium installation for successful pip/pipx installs whenever the freshly installed CLI is not yet on PATH. Use a post-install path that doesn't depend on `openbrowser-ai` or `uvx` being immediately available.</comment>

<file context>
@@ -157,10 +157,10 @@ if [ "$SKIP_BROWSER" = false ]; then
+    uvx playwright install chromium 2>/dev/null || warn "Chromium install failed (run 'openbrowser-ai install' manually)"
   else
-    "$PYTHON" -m playwright install chromium 2>/dev/null || warn "Chromium install skipped (run 'openbrowser-ai install' manually)"
+    warn "Chromium install skipped (run 'openbrowser-ai install' after installing uv)"
   fi
 fi
</file context>
Fix with Cubic

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PATH issue for freshly installed CLIs is pre-existing behavior unrelated to this PR. Fixed the warning message in fda5e2d to use a generic message that doesn't incorrectly tell users to install uv.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've saved this as a new learning to improve future reviews.

Comment thread install.ps1 Outdated
Comment thread install.sh Outdated
The bare `openbrowser-ai` command and `-p` flag import Agent/Controller
which require the [agent] extra (openai, langgraph, etc). Without the
extra, the import crashes with ModuleNotFoundError. Now catches the
ImportError and shows a clear message pointing to the correct install
command. MCP (-mcp), CLI daemon (-c), and install subcommands continue
to work without agent deps.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/openbrowser/cli.py`:
- Around line 67-70: The try/except around asyncio.run(client._start_daemon())
only catches TimeoutError and OSError but not asyncio.CancelledError; update the
exception handling for the best-effort daemon pre-start to also catch
asyncio.CancelledError (or use a broader exception like Exception if you prefer)
so that cancellation during await asyncio.sleep(0.2) inside
client._start_daemon() is swallowed and does not cause an unclean exit; modify
the try/except that wraps asyncio.run(client._start_daemon()) to include
asyncio.CancelledError (or Exception) alongside TimeoutError and OSError.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97ee417a-7c09-4378-8f54-5163152e0bdc

📥 Commits

Reviewing files that changed from the base of the PR and between 1c130b4 and 218e8fd.

📒 Files selected for processing (1)
  • src/openbrowser/cli.py

Comment thread src/openbrowser/cli.py Outdated
The Textual-based TUI was stuck/non-functional. Removed entirely:
- Removed OpenBrowserApp class and all Textual widget code (~1200 lines)
- Removed textual_interface() function
- Removed [cli] extra (textual dependency) from pyproject.toml
- Bare `openbrowser-ai` command now shows help with usage examples
- All other modes unaffected: -p (prompt), -c (code), --mcp, init, install
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/openbrowser/cli.py">

<violation number="1" location="src/openbrowser/cli.py:702">
P1: The new default branch removes the no-argument interactive CLI entirely and now only shows help.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/openbrowser/cli.py
traceback.print_exc()
sys.exit(1)
# No specific mode requested -- show help
click.echo(ctx.get_help())
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The new default branch removes the no-argument interactive CLI entirely and now only shows help.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/openbrowser/cli.py, line 702:

<comment>The new default branch removes the no-argument interactive CLI entirely and now only shows help.</comment>

<file context>
@@ -1955,92 +698,8 @@ def run_main_interface(ctx: click.Context, debug: bool = False, **kwargs):
-			traceback.print_exc()
-		sys.exit(1)
+	# No specific mode requested -- show help
+	click.echo(ctx.get_help())
 
 
</file context>
Fix with Cubic

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. The Textual TUI was non-functional (stuck on launch, never rendered properly). It was removed per project owner's request. The bare command now shows help with usage examples for the working modes: -p (prompt), -c (code execution), --mcp (MCP server), init, and install.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've saved this as a new learning to improve future reviews.

- Catch asyncio.CancelledError in daemon pre-start and status check
- Wrap status() call in try/except for robustness
- Fix misleading warning in install.sh/install.ps1 (don't mention uv specifically)
- Clarify uvx requirement for auto-install in README and quickstart docs
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/openbrowser/cli.py">

<violation number="1" location="src/openbrowser/cli.py:62">
P2: Don't treat a `status()` timeout as "daemon not running". A read timeout can happen while the daemon is still alive, so this path prints the cold-start help and tries to start a second daemon.

(Based on your team's feedback about excluding asyncio.TimeoutError from daemon auto-restart conditions.) [FEEDBACK_USED]</violation>
</file>

<file name="docs/quickstart.mdx">

<violation number="1" location="docs/quickstart.mdx:97">
P2: `openbrowser-ai install` is documented as a universal fallback, but it also requires `uvx`, so pip/pipx users without uv still hit a broken browser-install path.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:140">
P2: `openbrowser-ai install` is documented here as the manual fallback, but that command also requires `uvx`, so pip/pipx users without `uv` still have no working browser-install path.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/openbrowser/cli.py Outdated
Comment thread docs/quickstart.mdx Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 140: Update the README sentence about manual pre-install to state the
prerequisite: clarify that the `openbrowser-ai install` command is available
only if the `uvx` tool is present, e.g., change the sentence mentioning "To
pre-install manually: `openbrowser-ai install`" to explicitly note that this
install path requires `uvx` to be installed/available on the system so users
aren’t misled; reference `openbrowser-ai install` and `uvx` in the same sentence
for clarity.

In `@src/openbrowser/cli.py`:
- Line 637: Update the click option help for the '-p/--prompt' flag to remove
the misleading "in headless mode" claim and use a neutral description; locate
the click.option declaration for '-p', '--prompt' (the CLI flag definition in
src/openbrowser/cli.py) and change its help string to something like "Run a
single task using the prompt interface" or "Run a single task (behavior may vary
by configuration)" so it doesn't assert headless behavior that is actually
controlled elsewhere.
- Around line 60-63: The best-effort probe calling asyncio.run(client.status())
may raise JSON parsing errors; update the exception handling around that call
(the try/except that assigns status) to also catch json.JSONDecodeError and
ValueError so parsing failures from client.status() are swallowed and status
simply becomes None; ensure the except clause includes these exception types
alongside TimeoutError, OSError, and asyncio.CancelledError.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 95c2c54a-1f40-45b5-86e5-d7c6abf83d33

📥 Commits

Reviewing files that changed from the base of the PR and between 218e8fd and fda5e2d.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • README.md
  • docs/quickstart.mdx
  • install.ps1
  • install.sh
  • pyproject.toml
  • src/openbrowser/cli.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • install.sh
  • docs/quickstart.mdx
  • install.ps1

Comment thread README.md Outdated
Comment thread src/openbrowser/cli.py
Comment thread src/openbrowser/cli.py Outdated
The pre-flight CDP check called _recover_browser_session() even when
browser_session was None (never created), causing it to launch a real
browser. In CI (no browser available), this hangs indefinitely.

Only attempt recovery when browser_session was previously set (i.e. the
browser died), not when it was never created.

Fixes CI test hang at test_mcp_server.py::TestExecuteCode.
- Separate TimeoutError handling in daemon status probe (daemon alive
  but slow should show compact help, not verbose)
- Add ValueError to exception handler for malformed daemon JSON
- Change -p help text from "headless mode" to "one-shot mode"
- Add "(requires uvx)" to manual pre-install note in README and docs
server.py does not import DAEMON_DIR (uses get_socket_path/get_pid_path
helpers instead). The env var OPENBROWSER_SOCKET already drives the
correct socket/pid paths in tests.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="README.md">

<violation number="1" location="README.md:140">
P2: The manual browser pre-install command is wrong for the documented `uvx` flow; `openbrowser-ai install` won't exist unless the package was installed separately.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread README.md
# or
playwright install chromium
```
> **No separate browser install needed.** OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found and `uvx` is available, Chromium is installed automatically on first run. To pre-install manually (requires `uvx`): `openbrowser-ai install`
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The manual browser pre-install command is wrong for the documented uvx flow; openbrowser-ai install won't exist unless the package was installed separately.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 140:

<comment>The manual browser pre-install command is wrong for the documented `uvx` flow; `openbrowser-ai install` won't exist unless the package was installed separately.</comment>

<file context>
@@ -137,7 +137,7 @@ pip install openbrowser-ai[azure]      # Azure OpenAI

-> No separate browser install needed. OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found and uvx is available, Chromium is installed automatically on first run. To pre-install manually: openbrowser-ai install
+> No separate browser install needed. OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found and uvx is available, Chromium is installed automatically on first run. To pre-install manually (requires uvx): openbrowser-ai install

Quick Start

</file context>


</details>

```suggestion
> **No separate browser install needed.** OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found and `uvx` is available, Chromium is installed automatically on first run. To pre-install manually (requires `uvx`): `uvx openbrowser-ai install`
Fix with Cubic

add_signal_handler raises RuntimeError when called from a non-main
thread. Catch it alongside NotImplementedError (Windows) so the daemon
can be embedded in background threads for testing or embedding.
The test previously relied on auto-starting a real daemon which tries to
launch a browser -- causing a 30s timeout in CI. Now starts a mock
daemon with a pre-initialized executor on a temp socket, then passes
OPENBROWSER_SOCKET to the CLI subprocess.
Use pytest.importorskip for ChatAnthropic, ChatOpenAI, ChatGoogle,
and ChatBrowserUse tests so they skip gracefully in envs without
the [agent] extra instead of failing with ImportError.
@billy-enrizky billy-enrizky merged commit 4c0a9ca into main Mar 15, 2026
8 checks passed
@billy-enrizky billy-enrizky deleted the fix/remove-playwright-dep branch March 15, 2026 22:50
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Openbrowser-AI Mar 15, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/test_advanced_features.py">

<violation number="1" location="tests/test_advanced_features.py:181">
P2: Don't skip `ChatBrowserUse` behind `litellm`; that package is unrelated to this import, so the test now false-skips and can miss breakages.</violation>
</file>

<file name="tests/test_cli_c_help.py">

<violation number="1" location="tests/test_cli_c_help.py:109">
P3: Close this background event loop after the daemon thread exits to avoid leaking an unclosed loop in the test process.</violation>

<violation number="2" location="tests/test_cli_c_help.py:129">
P2: Schedule the daemon stop event on its event loop instead of calling `asyncio.Event.set()` from the test thread.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.


def test_chat_browser_use_import(self):
"""Test ChatBrowserUse import."""
pytest.importorskip("litellm")
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Don't skip ChatBrowserUse behind litellm; that package is unrelated to this import, so the test now false-skips and can miss breakages.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/test_advanced_features.py, line 181:

<comment>Don't skip `ChatBrowserUse` behind `litellm`; that package is unrelated to this import, so the test now false-skips and can miss breakages.</comment>

<file context>
@@ -178,24 +178,28 @@ class TestNewLLMProviders:
 
     def test_chat_browser_use_import(self):
         """Test ChatBrowserUse import."""
+        pytest.importorskip("litellm")
         from openbrowser.llm import ChatBrowserUse
 
</file context>
Fix with Cubic

Comment thread tests/test_cli_c_help.py
time.sleep(0.05)
else:
server._running = False
server._stop_event.set()
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Schedule the daemon stop event on its event loop instead of calling asyncio.Event.set() from the test thread.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/test_cli_c_help.py, line 129:

<comment>Schedule the daemon stop event on its event loop instead of calling `asyncio.Event.set()` from the test thread.</comment>

<file context>
@@ -78,7 +86,68 @@ def test_c_no_arg_compact_when_daemon_running(self):
+            time.sleep(0.05)
+        else:
+            server._running = False
+            server._stop_event.set()
+            t.join(timeout=5)
+            pytest.fail('Mock daemon socket never appeared')
</file context>
Suggested change
server._stop_event.set()
loop.call_soon_threadsafe(server._stop_event.set)
Fix with Cubic

Comment thread tests/test_cli_c_help.py
})
server._executor = executor

loop = asyncio.new_event_loop()
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Close this background event loop after the daemon thread exits to avoid leaking an unclosed loop in the test process.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/test_cli_c_help.py, line 109:

<comment>Close this background event loop after the daemon thread exits to avoid leaking an unclosed loop in the test process.</comment>

<file context>
@@ -78,7 +86,68 @@ def test_c_no_arg_compact_when_daemon_running(self):
+        })
+        server._executor = executor
+
+        loop = asyncio.new_event_loop()
+
+        def run_daemon():
</file context>
Fix with Cubic

billy-enrizky added a commit that referenced this pull request Mar 18, 2026
- Catch asyncio.CancelledError in daemon pre-start and status check
- Wrap status() call in try/except for robustness
- Fix misleading warning in install.sh/install.ps1 (don't mention uv specifically)
- Clarify uvx requirement for auto-install in README and quickstart docs
billy-enrizky added a commit that referenced this pull request Mar 18, 2026
fix(deps): remove unused playwright dependency, clean up install docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants